
#!/bin/sh

VJA_PATH="$HOME/.local/bin/vja"

TASK_NAME=$(echo -n | dmenu -i -p "vja add:")
if [ -z "$TASK_NAME" ]; then
    notify-send -u critical -t 2000 "Empty input"
    exit 1
fi

COMMAND="$VJA_PATH add $TASK_NAME"
OUTPUT=$($COMMAND 2>&1)

if [ $? -eq 0 ]; then
    notify-send -t 1000 "Success" "$OUTPUT"
else
    notify-send -u critical -t 2000 "Error" "'$COMMAND' error: $OUTPUT"
fi

